package Exists;

public class Person implements Comparable<Person> {
    private String name;
    private Integer higth;
    private Integer weight;

    public Person() {
    }

    public Person(String name, Integer higth, Integer weight) {
        this.name = name;
        this.higth = higth;
        this.weight = weight;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getHigth() {
        return higth;
    }

    public void setHigth(Integer higth) {
        this.higth = higth;
    }

    public Integer getWeight() {
        return weight;
    }

    public void setWeight(Integer weight) {
        this.weight = weight;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", higth=" + higth +
                ", weight=" + weight +
                '}';
    }



    @Override
    public int compareTo(Person o) {
        int a = this.getHigth()-o.getHigth();
        if (a == 0){

            a = this.getWeight()-o.getWeight();
        }

        return a;

    }
}
